home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / sun / volume2 / contool3.0 / part01 < prev    next >
Encoding:
Internet Message Format  |  1990-09-25  |  48.7 KB

  1. Path: uunet!snorkelwacker!apple!sun-barr!rutgers!aramis.rutgers.edu!mcgrew
  2. From: mcgrew@aramis.rutgers.edu (Charles Mcgrew)
  3. Newsgroups: comp.sources.sun
  4. Subject: v02i020:  Contool 3.0, Part01/06
  5. Message-ID: <Sep.25.16.10.05.1990.25293@aramis.rutgers.edu>
  6. Date: 25 Sep 90 20:10:08 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 1494
  9. Approved: mcgrew@aramis.rutgers.edu
  10.  
  11. Submitted-by: chuck@trantor.harris-atd.com (Chuck Musciano)
  12. Posting-number: Volume 2, Issue 20
  13. Archive-name: contool3.0/part01
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 1 (of 6)."
  22. # Contents:  MANIFEST Makefile README contool.h error.c expand.c icons
  23. #   icons/default_bad.icon icons/default_flash.icon
  24. #   icons/default_good.icon icons/mask.icon images images/empty.icon
  25. #   images/range.icon images/single.icon load.c load_icon.c manifest.h
  26. #   patchlevel.h sample.filter window_misc.c
  27. # Wrapped by chuck@melmac on Fri Aug 17 10:00:50 1990
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  31. else
  32. echo shar: Extracting \"'MANIFEST'\" \(1168 characters\)
  33. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  34. X   File Name        Archive #    Description
  35. X-----------------------------------------------------------
  36. X MANIFEST                   1    This shipping list
  37. X Makefile                   1    
  38. X README                     1    
  39. X contool.c                  4    
  40. X contool.h                  1    
  41. X contool.info               3    
  42. X contool.man                3    
  43. X contool_ui.c               6    
  44. X contool_ui.h               2    
  45. X error.c                    1    
  46. X expand.c                   1    
  47. X filters.c                  5    
  48. X icons                      1    
  49. X icons/default_bad.icon     1    
  50. X icons/default_flash.icon   1    
  51. X icons/default_good.icon    1    
  52. X icons/mask.icon            1    
  53. X images                     1    
  54. X images/empty.icon          1    
  55. X images/range.icon          1    
  56. X images/single.icon         1    
  57. X lex.c                      2    
  58. X load.c                     1    
  59. X load_icon.c                1    
  60. X logging.c                  2    
  61. X manifest.h                 1    
  62. X misc.c                     2    
  63. X parse.y                    2    
  64. X patchlevel.h               1    
  65. X props.c                    3    
  66. X regexp.c                   2    
  67. X sample.filter              1    
  68. X store.c                    2    
  69. X window_misc.c              1    
  70. END_OF_FILE
  71. if test 1168 -ne `wc -c <'MANIFEST'`; then
  72.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  73. fi
  74. # end of 'MANIFEST'
  75. fi
  76. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  77.   echo shar: Will not clobber existing file \"'Makefile'\"
  78. else
  79. echo shar: Extracting \"'Makefile'\" \(1800 characters\)
  80. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  81. X# Where to put the executable
  82. XBIN        = /usr/local/bin
  83. X
  84. X# Where to put the man page
  85. XMAN        = /usr/man/manl
  86. XMANEXT        = l
  87. X
  88. X# Where to install the help file
  89. XHELPDIR        = /usr/local/lib/help
  90. X
  91. X# paths to be searched for icons
  92. XICON_PATH    = .:./icons:/usr/local/images:/usr/include/images
  93. X
  94. X# Where you installed Open Windows
  95. XOPENWINHOME    = /usr/openwin
  96. X
  97. X# Where your XView libraries are installed
  98. XLDFLAGS        = -L$(OPENWINHOME)/lib
  99. X
  100. X# Where your XView include files are installed
  101. XCPPFLAGS    = -I$(OPENWINHOME)/include
  102. X
  103. XCONTOOL        = contool.o contool_ui.o error.o expand.o filters.o load.o load_icon.o logging.o misc.o parse.o props.o regexp.o store.o window_misc.o
  104. X
  105. XOPTIONS        = -O
  106. X
  107. XLDLIBS        = -lxview -lolgx -lX
  108. X
  109. X.c.o:
  110. X    cc $(OPTIONS) $(CPPFLAGS) -c $<
  111. X
  112. X.y.o:
  113. X    yacc $<
  114. X    cc $(OPTIONS) -c -o $*.o y.tab.c
  115. X    rm y.tab.c
  116. X
  117. Xcontool: $(CONTOOL)
  118. X    cc $(OPTIONS) -o contool $(CONTOOL) $(LDFLAGS) $(LDLIBS)
  119. X
  120. Xinstall: contool $(MAN)/contool.$(MANEXT)
  121. X    cp contool $(BIN)
  122. X    chmod 755 $(BIN)/contool
  123. X    cp contool.info $(HELPDIR)
  124. X
  125. X$(MAN)/contool.$(MANEXT): contool.man
  126. X    cp -p contool.man $(MAN)/contool.$(MANEXT)
  127. X
  128. Xclean:
  129. X    rm -f *~ $(OFILES) contool core
  130. X
  131. X#dependencies
  132. X
  133. Xcontool.o: manifest.h contool.h contool_ui.h icons/default_good.icon \
  134. X     icons/default_bad.icon icons/default_flash.icon icons/mask.icon
  135. X
  136. Xcontool_ui.o: contool_ui.h
  137. X
  138. Xerror.o: manifest.h contool_ui.h
  139. X
  140. Xexpand.o: manifest.h
  141. X
  142. Xfilters.o: manifest.h contool.h contool_ui.h images/single.icon \
  143. X     images/range.icon images/empty.icon
  144. X
  145. Xload.o: manifest.h contool.h contool_ui.h
  146. X
  147. Xload_icon.o: manifest.h contool.h
  148. X
  149. Xlogging.o: manifest.h contool.h contool_ui.h
  150. X
  151. Xmisc.o: manifest.h contool.h
  152. X
  153. Xparse.y: manifest.h contool.h lex.c
  154. X
  155. Xprops.o: manifest.h contool.h contool_ui.h
  156. X
  157. Xregexp.o: manifest.h contool.h
  158. X
  159. Xstore.o: manifest.h contool.h contool_ui.h
  160. X
  161. Xwindow_misc.o: manifest.h contool_ui.h
  162. END_OF_FILE
  163. if test 1800 -ne `wc -c <'Makefile'`; then
  164.     echo shar: \"'Makefile'\" unpacked with wrong size!
  165. fi
  166. # end of 'Makefile'
  167. fi
  168. if test -f 'README' -a "${1}" != "-c" ; then 
  169.   echo shar: Will not clobber existing file \"'README'\"
  170. else
  171. echo shar: Extracting \"'README'\" \(7305 characters\)
  172. sed "s/^X//" >'README' <<'END_OF_FILE'
  173. X/************************************************************************/
  174. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  175. X/*                                    */
  176. X/*    Permission to use, copy, modify, and distribute this software    */
  177. X/*    and its documentation for any purpose and without fee is    */
  178. X/*    hereby granted, provided that the above copyright notice    */
  179. X/*    appear in all copies and that both that copyright notice and    */
  180. X/*    this permission notice appear in supporting documentation, and    */
  181. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  182. X/*    used in advertising or publicity pertaining to distribution    */
  183. X/*    of the software without specific, written prior permission.    */
  184. X/*    Chuck Musciano and Harris Corporation make no representations    */
  185. X/*    about the suitability of this software for any purpose.  It is    */
  186. X/*    provided "as is" without express or implied warranty.  This     */
  187. X/*    software may not be sold without the prior explicit permission    */
  188. X/*    of Harris Corporation.                        */
  189. X/************************************************************************/
  190. X
  191. X     Contool Version 3.0
  192. X     
  193. X     Contool will capture and display system console messages with timestamps.
  194. XIt is a replacement for the standard Sun console, which is created with 
  195. X"cmdtool -C".  Contool will flash its icon and beep when messages are written
  196. Xto the icon, so you can keep it closed on your desktop until a message arrives.
  197. XYou can modify this beeping and flashing behavior; see the man page for more
  198. Xdetails.
  199. X
  200. X     You can instruct contool to filter and ignore certain common console
  201. Xmessages.  The man page explains how to create a file of filters in 
  202. X~/.contool; the included sample.filter is how my filters are set up.  You
  203. Xcan modify this to suit yourself, and copy it to ~/.contool.
  204. X
  205. X     This version of contool will only work with Open Windows 2.0, from Sun,
  206. Xor the XView 2.0 libraries available via anonymous FTP from expo.lcs.mit.edu.
  207. XIn either case, obviously, you'll need to be running some version of X Windows.
  208. X
  209. X     There are no plans to produce a SunView version of contool 3.0.
  210. X     
  211. X     Before building contool, you need to check several site dependencies
  212. Xin the Makefile.  These dependencies are:
  213. X
  214. X    In Makefile:
  215. X        BIN        Where the executable will go, normally
  216. X                /usr/local/bin
  217. X
  218. X        MANDIR        Where the man page will go, normally
  219. X                /usr/man/manl
  220. X
  221. X        MANEXT        The man page extension, usually 'l',
  222. X                for local man pages.  You may want to
  223. X                make MANDIR /usr/man/man1, in which case
  224. X                MANEXT should be '1'.
  225. X
  226. X        HELPDIR        Where the context-sensitive help file
  227. X                will be stored.
  228. X
  229. X        ICON_PATH    Path to search (at runtime) for other
  230. X                icon files.  This path will only be used
  231. X                if the user does not have the ICON_PATH
  232. X                environment variable defined.  Should
  233. X                consist of a various directories
  234. X                separated by colons.
  235. X
  236. X        OPENWINHOME    Where you installed Open Windows.
  237. X                Alternately, where you installed the
  238. X                XView toolkit shipped with X11R4.  Must
  239. X                be a directory with a child directory
  240. X                named "include" which contains X and
  241. X                XView include files.
  242. X
  243. X        LDFLAGS        Where ld can find your XView libraries.
  244. X                If you compile with Open Windows, the
  245. X                default value should be correct.  If you
  246. X                are using the X11 XView libraries, you
  247. X                may need to modify this value.
  248. X
  249. X        CPPFLAGS    Where cpp can find your XView include
  250. X                files.  If you compile with Open Windows,
  251. X                the default value should be correct.  If
  252. X                you are using the X11 XView toolkit, you
  253. X                may need to modify this value.
  254. X
  255. XOnce you have adjusted these values, just type "make contool" or "make
  256. Xinstall".  
  257. X
  258. X     Contool honors window command line options, described in xview(1),
  259. Xso you can change the default window size, icon position, etc.  We like
  260. Xto bring contool up closed, using "-Wi".
  261. X
  262. X     Comments, bugs, to me, please.  I would be very interested in your 
  263. Ximpressions of contool and any suggestions you might have to make it better.
  264. XBy the way, there are a few convenient untility routines in misc.c you might
  265. Xfind useful in other programs you are writing.
  266. X
  267. XChuck Musciano
  268. XAdvanced Technology Department
  269. XHarris Corporation
  270. XPO Box 37, MS 3A/1912
  271. XMelbourne, FL 32902
  272. X(407) 727-6131
  273. XARPA: chuck@trantor.harris-atd.com
  274. X
  275. X******************************** KNOWN XVIEW BUG ********************************
  276. X*                                        *
  277. X*      It is a known bug in XView that if you bring up a dialog box with the    *
  278. X* pushpin out (the default) and display a menu without selecting an item from    *
  279. X* the menu, the dialog box will be closed.  This can be demonstrated in contool    *
  280. X* by bringing up the edit filters window, and displaying the "edit" menu     *
  281. X* without selecting an action.                            *
  282. X*                                        *
  283. X*      This bug has been reported to Sun, but will not be fixed until version    *
  284. X* 3.0 of XView.                                    *
  285. X*                                        *
  286. X*********************************************************************************
  287. X
  288. X*********************************************************************************
  289. X*                Change history                    *
  290. X*********************************************************************************
  291. X
  292. X         1.0    20 Jun 88    Original release
  293. X         1.1    30 Jun 88    Added -p option to pop open when messages
  294. X                        arrive.  Suggested by Doug Lind
  295. X                        (lind@perron.ms.washington.edu).
  296. X                     Added alternate icon sets for more attractive
  297. X                        appearance when messages arrive.  Alternate
  298. X                        set two is from David Eckelcamp 
  299. X                        (eckelcamp@mcc.com).
  300. X                     Cleaned up Makefile.  Again, courtesy of
  301. X                        David Eckelcamp.
  302. X    2.0    23 Aug 88    Added automatic reload of filters when
  303. X                   filter file is modified.  Suggested by
  304. X                   Craig Musicant (cmusican@stanford.prime.com).
  305. X                Filter strings are now regular expressions.
  306. X                   Provided by jqj@hogg.cc.uoregon.edu.
  307. X                Reworked frame menu, based upon diffs posted
  308. X                   to sun-source@titan.rice.edu.
  309. X                Added protection from overflowing the text edit
  310. X                   window when too many messages arrive.
  311. X                Filters can now be read from any file, not
  312. X                   just ~/.contool.
  313. X    2.1    10 Feb 89    Added logging capability, courtesy of
  314. X                   Gregory Bond (gnb@melba.bby.oz.au).
  315. X    2.2    19 Sep 89    Added filter editing.
  316. X                Added icon pathname completion, courtesy of
  317. X                   Mike Arms (sandia!marms@unmvax.cs.unm.edu).
  318. X                Added moving the blinking icon to the front,
  319. X                   courtesy of Peter Lennevi
  320. X                   (etxlevi@solsta.ericsson.se).
  321. X                Changed icon loading to use ICON_PATH, and
  322. X                   supported ~ expansion, suggested by
  323. X                   Larry Virden (osu-cis!chemabs!lwv27).
  324. X                Fixed multiple message alert handling,
  325. X                   as suggested by Ellery Chan
  326. X                   (ellery@trantor.harris-atd.com).
  327. X    3.0     6 Jun 90    Ported to XView toolkit, running under
  328. X                   Open Windows 2.0.
  329. X                Reworked interface to be OPEN LOOK
  330. X                   compliant.
  331. X                Added saving of default actions to
  332. X                   filter file.
  333. X                Removed large number of command line
  334. X                   options in lieu of properties
  335. X                   dialog box.
  336. X                Added ability to associate a command
  337. X                   to be executed when a message arrives.
  338. X                Added explicit filter reset capability.
  339. X                Added the ability to print the contents
  340. X                   of the console.  Suggested by 
  341. X                   Danielle Heinzer
  342. X                   (ESC1298%ESOC.BITNET@cunyvm.cuny.edu).
  343. X                Reworked console overflow handling,
  344. X                   courtesy of Matt Cohen
  345. X                   (sysnmc@magic706.chron.com).
  346. END_OF_FILE
  347. if test 7305 -ne `wc -c <'README'`; then
  348.     echo shar: \"'README'\" unpacked with wrong size!
  349. fi
  350. # end of 'README'
  351. fi
  352. if test -f 'contool.h' -a "${1}" != "-c" ; then 
  353.   echo shar: Will not clobber existing file \"'contool.h'\"
  354. else
  355. echo shar: Extracting \"'contool.h'\" \(2263 characters\)
  356. sed "s/^X//" >'contool.h' <<'END_OF_FILE'
  357. X/************************************************************************/
  358. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  359. X/*                                    */
  360. X/*    Permission to use, copy, modify, and distribute this software    */
  361. X/*    and its documentation for any purpose and without fee is    */
  362. X/*    hereby granted, provided that the above copyright notice    */
  363. X/*    appear in all copies and that both that copyright notice and    */
  364. X/*    this permission notice appear in supporting documentation, and    */
  365. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  366. X/*    used in advertising or publicity pertaining to distribution    */
  367. X/*    of the software without specific, written prior permission.    */
  368. X/*    Chuck Musciano and Harris Corporation make no representations    */
  369. X/*    about the suitability of this software for any purpose.  It is    */
  370. X/*    provided "as is" without express or implied warranty.  This     */
  371. X/*    software may not be sold without the prior explicit permission    */
  372. X/*    of Harris Corporation.                        */
  373. X/************************************************************************/
  374. X
  375. X/************************************************************************/
  376. X/*                                    */
  377. X/*    contool.h    internal contool data structures        */
  378. X/*                                    */
  379. X/************************************************************************/
  380. X
  381. X#define        is_null(x)        ((x)? x : "")
  382. X
  383. X#define        BEEP_BIT        0x01
  384. X#define        COMMAND_BIT        0x02
  385. X#define        FLASH_BIT        0x04
  386. X#define        OPEN_BIT        0x08
  387. X#define        STAMP_BIT        0x10
  388. X
  389. Xtypedef    struct    filter    Filter;
  390. Xtypedef    struct    props    Props;
  391. X
  392. Xstruct    filter    {char    *start;
  393. X         char    *start_re;
  394. X         int    start_circf;
  395. X         char    *stop;
  396. X         char    *stop_re;
  397. X         int    stop_circf;
  398. X         char    *comment;
  399. X         int    save;
  400. X         int    beep;
  401. X         int    flash;
  402. X         int    open;
  403. X         int    stamp;
  404. X         char    *command;
  405. X         Filter    *next;
  406. X        };
  407. X
  408. Xstruct    props    {int    beep;
  409. X         int    flash;
  410. X         int    open;
  411. X         int    stamp;
  412. X         char    *command;
  413. X         char    *good_icon;
  414. X         char    *bad_icon;
  415. X         char    *flash_icon;
  416. X         char    *print_filter;
  417. X         char    *log_file;
  418. X         int    log_after;
  419. X         int    stamp_resolution;
  420. X         int    max_size;
  421. X         int    delete_amount;
  422. X        };
  423. X
  424. XPUBLIC    char    *compile_exp();
  425. XPUBLIC    char    *expand_tilde();
  426. X
  427. XPUBLIC    Props    defaults;
  428. XPUBLIC    Props    *parsed_defaults;
  429. XPUBLIC    Filter    *parsed_filters;
  430. XPUBLIC    Filter    *filters;
  431. XPUBLIC    int    parse_errors_occured;
  432. XPUBLIC    char    *filter_file;
  433. END_OF_FILE
  434. if test 2263 -ne `wc -c <'contool.h'`; then
  435.     echo shar: \"'contool.h'\" unpacked with wrong size!
  436. fi
  437. # end of 'contool.h'
  438. fi
  439. if test -f 'error.c' -a "${1}" != "-c" ; then 
  440.   echo shar: Will not clobber existing file \"'error.c'\"
  441. else
  442. echo shar: Extracting \"'error.c'\" \(2101 characters\)
  443. sed "s/^X//" >'error.c' <<'END_OF_FILE'
  444. X/************************************************************************/
  445. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  446. X/*                                    */
  447. X/*    Permission to use, copy, modify, and distribute this software    */
  448. X/*    and its documentation for any purpose and without fee is    */
  449. X/*    hereby granted, provided that the above copyright notice    */
  450. X/*    appear in all copies and that both that copyright notice and    */
  451. X/*    this permission notice appear in supporting documentation, and    */
  452. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  453. X/*    used in advertising or publicity pertaining to distribution    */
  454. X/*    of the software without specific, written prior permission.    */
  455. X/*    Chuck Musciano and Harris Corporation make no representations    */
  456. X/*    about the suitability of this software for any purpose.  It is    */
  457. X/*    provided "as is" without express or implied warranty.  This     */
  458. X/*    software may not be sold without the prior explicit permission    */
  459. X/*    of Harris Corporation.                        */
  460. X/************************************************************************/
  461. X
  462. X/************************************************************************/
  463. X/*                                    */
  464. X/*    error.c        handle error messages                */
  465. X/*                                    */
  466. X/************************************************************************/
  467. X
  468. X#include    <stdio.h>
  469. X#include    <xview/xview.h>
  470. X#include    <xview/notice.h>
  471. X
  472. X#include    "manifest.h"
  473. X#include    "contool_ui.h"
  474. X
  475. XPUBLIC    contool_base_objects    *contool_base;
  476. X
  477. X/************************************************************************/
  478. XPRIVATE    void    show_error(msg)
  479. X
  480. Xchar    *msg;
  481. X
  482. X{
  483. X    notice_prompt(contool_base->base, NULL,
  484. X                 NOTICE_MESSAGE_STRINGS, msg, 0,
  485. X                 NOTICE_BUTTON_YES, "OK",
  486. X              0);
  487. X}
  488. X
  489. X/************************************************************************/
  490. XEXPORT    void    error(a, b, c, d, e, f)
  491. X
  492. Xchar    *a, *b, *c, *d, *e, *f;
  493. X
  494. X{    char    buf[1024];
  495. X
  496. X    sprintf(buf, a, b, c, d, e, f);
  497. X    show_error(buf);
  498. X}
  499. X
  500. X/************************************************************************/
  501. XEXPORT    void    abend(a, b, c, d, e, f)
  502. X
  503. Xchar    *a, *b, *c, *d, *e, *f;
  504. X
  505. X{
  506. X    error(a, b, c, d, e, f);
  507. X    exit(1);
  508. X}
  509. END_OF_FILE
  510. if test 2101 -ne `wc -c <'error.c'`; then
  511.     echo shar: \"'error.c'\" unpacked with wrong size!
  512. fi
  513. # end of 'error.c'
  514. fi
  515. if test -f 'expand.c' -a "${1}" != "-c" ; then 
  516.   echo shar: Will not clobber existing file \"'expand.c'\"
  517. else
  518. echo shar: Extracting \"'expand.c'\" \(3088 characters\)
  519. sed "s/^X//" >'expand.c' <<'END_OF_FILE'
  520. X/************************************************************************/
  521. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  522. X/*                                    */
  523. X/*    Permission to use, copy, modify, and distribute this software    */
  524. X/*    and its documentation for any purpose and without fee is    */
  525. X/*    hereby granted, provided that the above copyright notice    */
  526. X/*    appear in all copies and that both that copyright notice and    */
  527. X/*    this permission notice appear in supporting documentation, and    */
  528. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  529. X/*    used in advertising or publicity pertaining to distribution    */
  530. X/*    of the software without specific, written prior permission.    */
  531. X/*    Chuck Musciano and Harris Corporation make no representations    */
  532. X/*    about the suitability of this software for any purpose.  It is    */
  533. X/*    provided "as is" without express or implied warranty.  This     */
  534. X/*    software may not be sold without the prior explicit permission    */
  535. X/*    of Harris Corporation.                        */
  536. X/************************************************************************/
  537. X
  538. X#include    <sys/types.h>
  539. X#include    <sys/dir.h>
  540. X#include    <pwd.h>
  541. X
  542. X#include    "manifest.h"
  543. X
  544. XPUBLIC    char    *rindex(), *index();
  545. X
  546. X/************************************************************************/
  547. XPRIVATE    char    *root_path(path)
  548. X
  549. Xchar    *path;
  550. X
  551. X{    char    *p;
  552. X
  553. X    if (p = rindex(path, '/'))
  554. X       if (p == path)
  555. X          p[1] = '\0';
  556. X       else
  557. X          *p = '\0';
  558. X    else
  559. X       *path = '\0';
  560. X    return(path);
  561. X}
  562. X
  563. X/************************************************************************/
  564. XPRIVATE    char    *last_node(path)
  565. X
  566. Xchar    *path;
  567. X
  568. X{    char    *p;
  569. X
  570. X    return((p = rindex(path, '/'))? p + 1 : path);
  571. X}
  572. X
  573. X/************************************************************************/
  574. XEXPORT    char    *expand_filename(path)
  575. X
  576. Xchar    *path;
  577. X
  578. X{    static    char    s[1024];
  579. X    char    pattern[1024], candidate[1024], *p,*q;
  580. X    DIR    *dir;
  581. X    struct    direct *dp;
  582. X    struct    passwd    *pw;
  583. X
  584. X    strcpy(s, path);
  585. X    if (*path == '~')
  586. X       if (path[1] == '/' || path[1] == '\0') {
  587. X          strcpy(s, getenv("HOME"));
  588. X          strcat(s, path + 1);
  589. X          }
  590. X       else {
  591. X          if ((p = index(path, '/')) != NULL)
  592. X             *p = '\0';
  593. X          if ((pw = getpwnam(path + 1)) != NULL) {
  594. X             strcpy(s, pw->pw_dir);
  595. X             if (p != NULL) {
  596. X                strcat(s, "/");
  597. X                strcat(s, p + 1);
  598. X                }
  599. X             }
  600. X          else
  601. X             return(NULL);
  602. X          }
  603. X    strcpy(pattern, last_node(s));
  604. X    if (*pattern == '\0')
  605. X       return(s);
  606. X    root_path(s);
  607. X    candidate[0] = '\0';
  608. X    if (*s == '\0')
  609. X       strcpy(s, ".");
  610. X    if ((dir = opendir(s)) == NULL) {
  611. X       strcpy(s, path);
  612. X       return(s);
  613. X       }
  614. X    while ((dp = readdir(dir)) != NULL)
  615. X       if (strncmp(dp->d_name, pattern, strlen(pattern)) == 0)
  616. X          if (*candidate == '\0')
  617. X             strcpy(candidate, dp->d_name);
  618. X          else {
  619. X             for (p = candidate, q = dp->d_name; *p == *q; p++, q++)
  620. X                ;
  621. X             *p = '\0';
  622. X             }
  623. X    closedir(dir);
  624. X    if (*candidate == '\0')
  625. X       return(NULL);
  626. X    else {
  627. X       if (strcmp(s, ".") == 0)
  628. X          *s = '\0';
  629. X       else if (s[strlen(s) - 1] != '/')
  630. X          strcat(s, "/");
  631. X       strcat(s, candidate);
  632. X       }
  633. X    return(s);
  634. X}
  635. END_OF_FILE
  636. if test 3088 -ne `wc -c <'expand.c'`; then
  637.     echo shar: \"'expand.c'\" unpacked with wrong size!
  638. fi
  639. # end of 'expand.c'
  640. fi
  641. if test ! -d 'icons' ; then
  642.     echo shar: Creating directory \"'icons'\"
  643.     mkdir 'icons'
  644. fi
  645. if test -f 'icons/default_bad.icon' -a "${1}" != "-c" ; then 
  646.   echo shar: Will not clobber existing file \"'icons/default_bad.icon'\"
  647. else
  648. echo shar: Extracting \"'icons/default_bad.icon'\" \(1997 characters\)
  649. sed "s/^X//" >'icons/default_bad.icon' <<'END_OF_FILE'
  650. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  651. X */
  652. X    0x0000,0x0000,0x0000,0x0000,
  653. X    0x0000,0x0000,0x0000,0x0000,
  654. X    0x0000,0x0000,0x0000,0x0000,
  655. X    0x0000,0x0000,0x0000,0x0000,
  656. X    0x0000,0x0000,0x0000,0x0000,
  657. X    0x0000,0x0000,0x0000,0x0000,
  658. X    0x0000,0x0000,0x0000,0x0000,
  659. X    0x0000,0xFFFF,0xFFFE,0x0000,
  660. X    0x0001,0xFFFF,0xFFFF,0x0000,
  661. X    0x0001,0x8000,0x0003,0x0000,
  662. X    0x0001,0xBFFF,0xFFFB,0x0000,
  663. X    0x0001,0xBFFF,0xFFFB,0x0000,
  664. X    0x0001,0xBFFF,0xFFFB,0x0000,
  665. X    0x0001,0xBFFF,0xFFFB,0x0000,
  666. X    0x0001,0xBFFF,0xFFFB,0x0000,
  667. X    0x0001,0xBFFF,0xFFFB,0x0000,
  668. X    0x0001,0xBFFF,0xFFFB,0x0000,
  669. X    0x0001,0xBFFF,0xFFFB,0x0000,
  670. X    0x0001,0xBFFF,0xFFFB,0x0000,
  671. X    0x0001,0xBFFF,0xFFFB,0x0000,
  672. X    0x0001,0xBFFF,0xFFFB,0x0000,
  673. X    0x0001,0xBFFF,0xFFFB,0x0000,
  674. X    0x0001,0xBFFF,0xFFFB,0x0000,
  675. X    0x0001,0xBFFF,0xFFFB,0x0000,
  676. X    0x0001,0xBFFF,0xFFFB,0x0000,
  677. X    0x0001,0xBFFF,0xFFFB,0x0000,
  678. X    0x0001,0xBFFF,0xFFFB,0x0000,
  679. X    0x0001,0xBFFF,0xFFFB,0x0000,
  680. X    0x0001,0xBFFF,0xFFFB,0x0000,
  681. X    0x0001,0x8000,0x0003,0x0000,
  682. X    0x0001,0xFFFF,0xFFFF,0x0000,
  683. X    0x0000,0xFFFF,0xFFFE,0x0000,
  684. X    0x0000,0x0000,0x0000,0x0000,
  685. X    0x0000,0x0000,0x0000,0x0000,
  686. X    0x000F,0xFFFF,0xFFFF,0xE000,
  687. X    0x0018,0x0000,0x0000,0x3000,
  688. X    0x0031,0x5555,0x5555,0x1800,
  689. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  690. X    0x00C5,0x5555,0x5555,0x4600,
  691. X    0x00C0,0x0000,0x0000,0x0600,
  692. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  693. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  694. X    0x0000,0x0000,0x0000,0x0000,
  695. X    0x0000,0x0000,0x0000,0x0000,
  696. X    0x0000,0x0000,0x0000,0x0000,
  697. X    0x0000,0x0000,0x0000,0x0000,
  698. X    0x0000,0x0000,0x0000,0x0000,
  699. X    0x0000,0x0000,0x0000,0x0000,
  700. X    0x0000,0x0000,0x0000,0x0000,
  701. X    0x0000,0x0000,0x0004,0x0000,
  702. X    0x0000,0x0000,0x0004,0x0000,
  703. X    0x0000,0x0000,0x0004,0x0000,
  704. X    0x000E,0x30B0,0xE184,0x7000,
  705. X    0x0010,0x48C9,0x0244,0x8800,
  706. X    0x0020,0x8489,0x0424,0x8800,
  707. X    0x0020,0x8488,0xC424,0xF800,
  708. X    0x0020,0x8488,0x2424,0x8000,
  709. X    0x0010,0x4888,0x2244,0x8800,
  710. X    0x000E,0x3089,0xC184,0x7000,
  711. X    0x0000,0x0000,0x0000,0x0000,
  712. X    0x0000,0x0000,0x0000,0x0000,
  713. X    0x0000,0x0000,0x0000,0x0000,
  714. X    0x0000,0x0000,0x0000,0x0000,
  715. X    0x0000,0x0000,0x0000,0x0000
  716. END_OF_FILE
  717. if test 1997 -ne `wc -c <'icons/default_bad.icon'`; then
  718.     echo shar: \"'icons/default_bad.icon'\" unpacked with wrong size!
  719. fi
  720. # end of 'icons/default_bad.icon'
  721. fi
  722. if test -f 'icons/default_flash.icon' -a "${1}" != "-c" ; then 
  723.   echo shar: Will not clobber existing file \"'icons/default_flash.icon'\"
  724. else
  725. echo shar: Extracting \"'icons/default_flash.icon'\" \(1997 characters\)
  726. sed "s/^X//" >'icons/default_flash.icon' <<'END_OF_FILE'
  727. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  728. X */
  729. X    0x0000,0x0000,0x0000,0x0000,
  730. X    0x0000,0x0000,0x0000,0x0000,
  731. X    0x0000,0x0000,0x0000,0x0000,
  732. X    0x0000,0x0000,0x0000,0x0000,
  733. X    0x0000,0x0000,0x0000,0x0000,
  734. X    0x0000,0x0000,0x0000,0x0000,
  735. X    0x0000,0x0000,0x0000,0x0000,
  736. X    0x0000,0xFFFF,0xFFFE,0x0000,
  737. X    0x0001,0xFFFF,0xFFFF,0x0000,
  738. X    0x0001,0x8000,0x0003,0x0000,
  739. X    0x0001,0xBFFF,0xFFFB,0x0000,
  740. X    0x0001,0xA000,0x000B,0x0000,
  741. X    0x0001,0xA000,0x000B,0x0000,
  742. X    0x0001,0xA000,0x000B,0x0000,
  743. X    0x0001,0xA000,0x000B,0x0000,
  744. X    0x0001,0xA000,0x000B,0x0000,
  745. X    0x0001,0xA000,0x000B,0x0000,
  746. X    0x0001,0xA000,0x000B,0x0000,
  747. X    0x0001,0xA000,0x000B,0x0000,
  748. X    0x0001,0xA000,0x000B,0x0000,
  749. X    0x0001,0xA000,0x000B,0x0000,
  750. X    0x0001,0xA000,0x000B,0x0000,
  751. X    0x0001,0xA000,0x000B,0x0000,
  752. X    0x0001,0xA000,0x000B,0x0000,
  753. X    0x0001,0xA000,0x000B,0x0000,
  754. X    0x0001,0xA000,0x000B,0x0000,
  755. X    0x0001,0xA000,0x000B,0x0000,
  756. X    0x0001,0xA000,0x000B,0x0000,
  757. X    0x0001,0xBFFF,0xFFFB,0x0000,
  758. X    0x0001,0x8000,0x0003,0x0000,
  759. X    0x0001,0xFFFF,0xFFFF,0x0000,
  760. X    0x0000,0xFFFF,0xFFFE,0x0000,
  761. X    0x0000,0x0000,0x0000,0x0000,
  762. X    0x0000,0x0000,0x0000,0x0000,
  763. X    0x000F,0xFFFF,0xFFFF,0xE000,
  764. X    0x0018,0x0000,0x0000,0x3000,
  765. X    0x0031,0x5555,0x5555,0x1800,
  766. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  767. X    0x00C5,0x5555,0x5555,0x4600,
  768. X    0x00C0,0x0000,0x0000,0x0600,
  769. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  770. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  771. X    0x0000,0x0000,0x0000,0x0000,
  772. X    0x0000,0x0000,0x0000,0x0000,
  773. X    0x0000,0x0000,0x0000,0x0000,
  774. X    0x0000,0x0000,0x0000,0x0000,
  775. X    0x0000,0x0000,0x0000,0x0000,
  776. X    0x0000,0x0000,0x0000,0x0000,
  777. X    0x0000,0x0000,0x0000,0x0000,
  778. X    0x0000,0x0000,0x0004,0x0000,
  779. X    0x0000,0x0000,0x0004,0x0000,
  780. X    0x0000,0x0000,0x0004,0x0000,
  781. X    0x000E,0x30B0,0xE184,0x7000,
  782. X    0x0010,0x48C9,0x0244,0x8800,
  783. X    0x0020,0x8489,0x0424,0x8800,
  784. X    0x0020,0x8488,0xC424,0xF800,
  785. X    0x0020,0x8488,0x2424,0x8000,
  786. X    0x0010,0x4888,0x2244,0x8800,
  787. X    0x000E,0x3089,0xC184,0x7000,
  788. X    0x0000,0x0000,0x0000,0x0000,
  789. X    0x0000,0x0000,0x0000,0x0000,
  790. X    0x0000,0x0000,0x0000,0x0000,
  791. X    0x0000,0x0000,0x0000,0x0000,
  792. X    0x0000,0x0000,0x0000,0x0000
  793. END_OF_FILE
  794. if test 1997 -ne `wc -c <'icons/default_flash.icon'`; then
  795.     echo shar: \"'icons/default_flash.icon'\" unpacked with wrong size!
  796. fi
  797. # end of 'icons/default_flash.icon'
  798. fi
  799. if test -f 'icons/default_good.icon' -a "${1}" != "-c" ; then 
  800.   echo shar: Will not clobber existing file \"'icons/default_good.icon'\"
  801. else
  802. echo shar: Extracting \"'icons/default_good.icon'\" \(1997 characters\)
  803. sed "s/^X//" >'icons/default_good.icon' <<'END_OF_FILE'
  804. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  805. X */
  806. X    0x0000,0x0000,0x0000,0x0000,
  807. X    0x0000,0x0000,0x0000,0x0000,
  808. X    0x0000,0x0000,0x0000,0x0000,
  809. X    0x0000,0x0000,0x0000,0x0000,
  810. X    0x0000,0x0000,0x0000,0x0000,
  811. X    0x0000,0x0000,0x0000,0x0000,
  812. X    0x0000,0x0000,0x0000,0x0000,
  813. X    0x0000,0xFFFF,0xFFFE,0x0000,
  814. X    0x0001,0xFFFF,0xFFFF,0x0000,
  815. X    0x0001,0x8000,0x0003,0x0000,
  816. X    0x0001,0xBFFF,0xFFFB,0x0000,
  817. X    0x0001,0xB555,0x555B,0x0000,
  818. X    0x0001,0xAAAA,0xAAAB,0x0000,
  819. X    0x0001,0xB555,0x555B,0x0000,
  820. X    0x0001,0xAAAA,0xA02B,0x0000,
  821. X    0x0001,0xB555,0x505B,0x0000,
  822. X    0x0001,0xAAAA,0xA02B,0x0000,
  823. X    0x0001,0xB555,0x505B,0x0000,
  824. X    0x0001,0xAAAA,0xA02B,0x0000,
  825. X    0x0001,0xB555,0x555B,0x0000,
  826. X    0x0001,0xAAAA,0xAAAB,0x0000,
  827. X    0x0001,0xB555,0x555B,0x0000,
  828. X    0x0001,0xAAAA,0xAAAB,0x0000,
  829. X    0x0001,0xB555,0x555B,0x0000,
  830. X    0x0001,0xAAAA,0xAAAB,0x0000,
  831. X    0x0001,0xB555,0x555B,0x0000,
  832. X    0x0001,0xAAAA,0xAAAB,0x0000,
  833. X    0x0001,0xB555,0x555B,0x0000,
  834. X    0x0001,0xBFFF,0xFFFB,0x0000,
  835. X    0x0001,0x8000,0x0003,0x0000,
  836. X    0x0001,0xFFFF,0xFFFF,0x0000,
  837. X    0x0000,0xFFFF,0xFFFE,0x0000,
  838. X    0x0000,0x0000,0x0000,0x0000,
  839. X    0x0000,0x0000,0x0000,0x0000,
  840. X    0x000F,0xFFFF,0xFFFF,0xE000,
  841. X    0x0018,0x0000,0x0000,0x3000,
  842. X    0x0031,0x5555,0x5555,0x1800,
  843. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  844. X    0x00C5,0x5555,0x5555,0x4600,
  845. X    0x00C0,0x0000,0x0000,0x0600,
  846. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  847. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  848. X    0x0000,0x0000,0x0000,0x0000,
  849. X    0x0000,0x0000,0x0000,0x0000,
  850. X    0x0000,0x0000,0x0000,0x0000,
  851. X    0x0000,0x0000,0x0000,0x0000,
  852. X    0x0000,0x0000,0x0000,0x0000,
  853. X    0x0000,0x0000,0x0000,0x0000,
  854. X    0x0000,0x0000,0x0000,0x0000,
  855. X    0x0000,0x0000,0x0004,0x0000,
  856. X    0x0000,0x0000,0x0004,0x0000,
  857. X    0x0000,0x0000,0x0004,0x0000,
  858. X    0x000E,0x30B0,0xE184,0x7000,
  859. X    0x0010,0x48C9,0x0244,0x8800,
  860. X    0x0020,0x8489,0x0424,0x8800,
  861. X    0x0020,0x8488,0xC424,0xF800,
  862. X    0x0020,0x8488,0x2424,0x8000,
  863. X    0x0010,0x4888,0x2244,0x8800,
  864. X    0x000E,0x3089,0xC184,0x7000,
  865. X    0x0000,0x0000,0x0000,0x0000,
  866. X    0x0000,0x0000,0x0000,0x0000,
  867. X    0x0000,0x0000,0x0000,0x0000,
  868. X    0x0000,0x0000,0x0000,0x0000,
  869. X    0x0000,0x0000,0x0000,0x0000
  870. END_OF_FILE
  871. if test 1997 -ne `wc -c <'icons/default_good.icon'`; then
  872.     echo shar: \"'icons/default_good.icon'\" unpacked with wrong size!
  873. fi
  874. # end of 'icons/default_good.icon'
  875. fi
  876. if test -f 'icons/mask.icon' -a "${1}" != "-c" ; then 
  877.   echo shar: Will not clobber existing file \"'icons/mask.icon'\"
  878. else
  879. echo shar: Extracting \"'icons/mask.icon'\" \(1997 characters\)
  880. sed "s/^X//" >'icons/mask.icon' <<'END_OF_FILE'
  881. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  882. X */
  883. X    0x0000,0x0000,0x0000,0x0000,
  884. X    0x0000,0x0000,0x0000,0x0000,
  885. X    0x0000,0x0000,0x0000,0x0000,
  886. X    0x0000,0x0000,0x0000,0x0000,
  887. X    0x0000,0x0000,0x0000,0x0000,
  888. X    0x0000,0x0000,0x0000,0x0000,
  889. X    0x0000,0x0000,0x0000,0x0000,
  890. X    0x0000,0xFFFF,0xFFFE,0x0000,
  891. X    0x0001,0xFFFF,0xFFFF,0x0000,
  892. X    0x0001,0xFFFF,0xFFFF,0x0000,
  893. X    0x0001,0xFFFF,0xFFFF,0x0000,
  894. X    0x0001,0xFFFF,0xFFFF,0x0000,
  895. X    0x0001,0xFFFF,0xFFFF,0x0000,
  896. X    0x0001,0xFFFF,0xFFFF,0x0000,
  897. X    0x0001,0xFFFF,0xFFFF,0x0000,
  898. X    0x0001,0xFFFF,0xFFFF,0x0000,
  899. X    0x0001,0xFFFF,0xFFFF,0x0000,
  900. X    0x0001,0xFFFF,0xFFFF,0x0000,
  901. X    0x0001,0xFFFF,0xFFFF,0x0000,
  902. X    0x0001,0xFFFF,0xFFFF,0x0000,
  903. X    0x0001,0xFFFF,0xFFFF,0x0000,
  904. X    0x0001,0xFFFF,0xFFFF,0x0000,
  905. X    0x0001,0xFFFF,0xFFFF,0x0000,
  906. X    0x0001,0xFFFF,0xFFFF,0x0000,
  907. X    0x0001,0xFFFF,0xFFFF,0x0000,
  908. X    0x0001,0xFFFF,0xFFFF,0x0000,
  909. X    0x0001,0xFFFF,0xFFFF,0x0000,
  910. X    0x0001,0xFFFF,0xFFFF,0x0000,
  911. X    0x0001,0xFFFF,0xFFFF,0x0000,
  912. X    0x0001,0xFFFF,0xFFFF,0x0000,
  913. X    0x0001,0xFFFF,0xFFFF,0x0000,
  914. X    0x0000,0xFFFF,0xFFFE,0x0000,
  915. X    0x0000,0x0000,0x0000,0x0000,
  916. X    0x0000,0x0000,0x0000,0x0000,
  917. X    0x000F,0xFFFF,0xFFFF,0xE000,
  918. X    0x001F,0xFFFF,0xFFFF,0xF000,
  919. X    0x003F,0xFFFF,0xFFFF,0xF800,
  920. X    0x007F,0xFFFF,0xFFFF,0xFC00,
  921. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  922. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  923. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  924. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  925. X    0x0000,0x0000,0x0000,0x0000,
  926. X    0x0000,0x0000,0x0000,0x0000,
  927. X    0x0000,0x0000,0x0000,0x0000,
  928. X    0x0000,0x0000,0x0000,0x0000,
  929. X    0x0000,0x0000,0x0000,0x0000,
  930. X    0x0000,0x0000,0x0000,0x0000,
  931. X    0x0000,0x0000,0x0000,0x0000,
  932. X    0x0000,0x0000,0x0004,0x0000,
  933. X    0x0000,0x0000,0x0004,0x0000,
  934. X    0x0000,0x0000,0x0004,0x0000,
  935. X    0x000E,0x30B0,0xE184,0x7000,
  936. X    0x0010,0x48C9,0x0244,0x8800,
  937. X    0x0020,0x8489,0x0424,0x8800,
  938. X    0x0020,0x8488,0xC424,0xF800,
  939. X    0x0020,0x8488,0x2424,0x8000,
  940. X    0x0010,0x4888,0x2244,0x8800,
  941. X    0x000E,0x3089,0xC184,0x7000,
  942. X    0x0000,0x0000,0x0000,0x0000,
  943. X    0x0000,0x0000,0x0000,0x0000,
  944. X    0x0000,0x0000,0x0000,0x0000,
  945. X    0x0000,0x0000,0x0000,0x0000,
  946. X    0x0000,0x0000,0x0000,0x0000
  947. END_OF_FILE
  948. if test 1997 -ne `wc -c <'icons/mask.icon'`; then
  949.     echo shar: \"'icons/mask.icon'\" unpacked with wrong size!
  950. fi
  951. # end of 'icons/mask.icon'
  952. fi
  953. if test ! -d 'images' ; then
  954.     echo shar: Creating directory \"'images'\"
  955.     mkdir 'images'
  956. fi
  957. if test -f 'images/empty.icon' -a "${1}" != "-c" ; then 
  958.   echo shar: Will not clobber existing file \"'images/empty.icon'\"
  959. else
  960. echo shar: Extracting \"'images/empty.icon'\" \(193 characters\)
  961. sed "s/^X//" >'images/empty.icon' <<'END_OF_FILE'
  962. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  963. X */
  964. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  965. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  966. END_OF_FILE
  967. if test 193 -ne `wc -c <'images/empty.icon'`; then
  968.     echo shar: \"'images/empty.icon'\" unpacked with wrong size!
  969. fi
  970. # end of 'images/empty.icon'
  971. fi
  972. if test -f 'images/range.icon' -a "${1}" != "-c" ; then 
  973.   echo shar: Will not clobber existing file \"'images/range.icon'\"
  974. else
  975. echo shar: Extracting \"'images/range.icon'\" \(193 characters\)
  976. sed "s/^X//" >'images/range.icon' <<'END_OF_FILE'
  977. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  978. X */
  979. X    0x9440,0xBF68,0x0000,0x8000,0xF6DE,0x0000,0x8A22,0xDFBB,
  980. X    0x0000,0xA100,0xBBB6,0x0000,0x8824,0xEDB7,0x0000,0x0000
  981. END_OF_FILE
  982. if test 193 -ne `wc -c <'images/range.icon'`; then
  983.     echo shar: \"'images/range.icon'\" unpacked with wrong size!
  984. fi
  985. # end of 'images/range.icon'
  986. fi
  987. if test -f 'images/single.icon' -a "${1}" != "-c" ; then 
  988.   echo shar: Will not clobber existing file \"'images/single.icon'\"
  989. else
  990. echo shar: Extracting \"'images/single.icon'\" \(193 characters\)
  991. sed "s/^X//" >'images/single.icon' <<'END_OF_FILE'
  992. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  993. X */
  994. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8A22,0xDFBB,
  995. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  996. END_OF_FILE
  997. if test 193 -ne `wc -c <'images/single.icon'`; then
  998.     echo shar: \"'images/single.icon'\" unpacked with wrong size!
  999. fi
  1000. # end of 'images/single.icon'
  1001. fi
  1002. if test -f 'load.c' -a "${1}" != "-c" ; then 
  1003.   echo shar: Will not clobber existing file \"'load.c'\"
  1004. else
  1005. echo shar: Extracting \"'load.c'\" \(3321 characters\)
  1006. sed "s/^X//" >'load.c' <<'END_OF_FILE'
  1007. X/************************************************************************/
  1008. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1009. X/*                                    */
  1010. X/*    Permission to use, copy, modify, and distribute this software    */
  1011. X/*    and its documentation for any purpose and without fee is    */
  1012. X/*    hereby granted, provided that the above copyright notice    */
  1013. X/*    appear in all copies and that both that copyright notice and    */
  1014. X/*    this permission notice appear in supporting documentation, and    */
  1015. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1016. X/*    used in advertising or publicity pertaining to distribution    */
  1017. X/*    of the software without specific, written prior permission.    */
  1018. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1019. X/*    about the suitability of this software for any purpose.  It is    */
  1020. X/*    provided "as is" without express or implied warranty.  This     */
  1021. X/*    software may not be sold without the prior explicit permission    */
  1022. X/*    of Harris Corporation.                        */
  1023. X/************************************************************************/
  1024. X
  1025. X/************************************************************************/
  1026. X/*                                    */
  1027. X/*    load.c        contool load dialog manager            */
  1028. X/*                                    */
  1029. X/************************************************************************/
  1030. X
  1031. X#include    <stdio.h>
  1032. X#include    <sys/param.h>
  1033. X#include    <sys/types.h>
  1034. X#include    <xview/xview.h>
  1035. X#include    <xview/panel.h>
  1036. X#include    <xview/xv_xrect.h>
  1037. X
  1038. X#include    "manifest.h"
  1039. X#include    "contool.h"
  1040. X#include    "contool_ui.h"
  1041. X
  1042. XPRIVATE    contool_load_objects    *contool_load = NULL;
  1043. X
  1044. X/************************************************************************/
  1045. XEXPORT    Menu_item    popup_load_config(item, op)
  1046. X
  1047. XMenu_item    item;
  1048. XMenu_generate    op;
  1049. X
  1050. X{    contool_base_objects * ip = (contool_base_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1051. X
  1052. X    if (op == MENU_NOTIFY) {
  1053. X       if (contool_load == NULL) {
  1054. X          contool_load = contool_load_objects_initialize(NULL, ip->base);
  1055. X          xv_set(contool_load->load_file,
  1056. X                      PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  1057. X                      PANEL_NOTIFY_STRING, "\n\r ",
  1058. X                   NULL);
  1059. X          xv_set(contool_load->load_type, PANEL_VALUE, 3, NULL);
  1060. X          place_dialog(ip->base, contool_load->load);
  1061. X          }
  1062. X       xv_set(contool_load->load_file, PANEL_VALUE, filter_file, NULL);
  1063. X       xv_set(contool_load->load, XV_SHOW, TRUE, NULL);
  1064. X       }
  1065. X    return item;
  1066. X}
  1067. X
  1068. X/************************************************************************/
  1069. XEXPORT    void    load_filters(item, event)
  1070. X
  1071. XPanel_item    item;
  1072. XEvent        *event;
  1073. X
  1074. X{    contool_load_objects    *ip = (contool_load_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1075. X    int    kind;
  1076. X    char    *path;
  1077. X
  1078. X    path = expand_tilde(xv_get(ip->load_file, PANEL_VALUE));
  1079. X    if (lex_init(path)) {
  1080. X       yyparse();
  1081. X       if (parse_errors_occured) {
  1082. X          error("Error in configuration file.  Configuration not loaded");
  1083. X          xv_set(ip->accept_load, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1084. X          }
  1085. X       else {
  1086. X          kind = (int) xv_get(ip->load_type, PANEL_VALUE);
  1087. X          if (kind & 1 && parsed_defaults)
  1088. X             defaults = *parsed_defaults;
  1089. X          if (kind & 2)
  1090. X             filters = parsed_filters;
  1091. X          free(parsed_defaults);
  1092. X          filter_file = path;
  1093. X          }
  1094. X       }
  1095. X    else {
  1096. X       error("Unable to read configuration file");
  1097. X       xv_set(ip->accept_load, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1098. X       free(path);
  1099. X       }
  1100. X}
  1101. END_OF_FILE
  1102. if test 3321 -ne `wc -c <'load.c'`; then
  1103.     echo shar: \"'load.c'\" unpacked with wrong size!
  1104. fi
  1105. # end of 'load.c'
  1106. fi
  1107. if test -f 'load_icon.c' -a "${1}" != "-c" ; then 
  1108.   echo shar: Will not clobber existing file \"'load_icon.c'\"
  1109. else
  1110. echo shar: Extracting \"'load_icon.c'\" \(2086 characters\)
  1111. sed "s/^X//" >'load_icon.c' <<'END_OF_FILE'
  1112. X/************************************************************************/
  1113. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1114. X/*                                    */
  1115. X/*    Permission to use, copy, modify, and distribute this software    */
  1116. X/*    and its documentation for any purpose and without fee is    */
  1117. X/*    hereby granted, provided that the above copyright notice    */
  1118. X/*    appear in all copies and that both that copyright notice and    */
  1119. X/*    this permission notice appear in supporting documentation, and    */
  1120. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1121. X/*    used in advertising or publicity pertaining to distribution    */
  1122. X/*    of the software without specific, written prior permission.    */
  1123. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1124. X/*    about the suitability of this software for any purpose.  It is    */
  1125. X/*    provided "as is" without express or implied warranty.  This     */
  1126. X/*    software may not be sold without the prior explicit permission    */
  1127. X/*    of Harris Corporation.                        */
  1128. X/************************************************************************/
  1129. X
  1130. X#include    <stdio.h>
  1131. X#include    <sys/file.h>
  1132. X
  1133. X#include    <xview/xview.h>
  1134. X#include    <xview/icon_load.h>
  1135. X
  1136. X#include    "manifest.h"
  1137. X#include    "contool.h"
  1138. X
  1139. XPUBLIC    char    *getenv();
  1140. X
  1141. X/************************************************************************/
  1142. XEXPORT    Server_image    load_icon(path, message)
  1143. X
  1144. Xchar    *path;
  1145. Xchar    *message;
  1146. X
  1147. X{    char    *icon_path, new_path[1024], *p, *q;
  1148. X
  1149. X    if (*path == '/')
  1150. X       return(icon_load_svrim(path, message));
  1151. X    else {
  1152. X       if ((p = getenv("ICON_PATH")) != NULL)
  1153. X          icon_path = strsave(p);
  1154. X       else
  1155. X          icon_path = strsave(ICON_PATH);
  1156. X       for (p = icon_path; *p; ) {
  1157. X          if (q = index(p, ':'))
  1158. X             *q = '\0';
  1159. X          strcpy(new_path, p);
  1160. X          strcat(new_path, "/");
  1161. X          strcat(new_path, path);
  1162. X          if (access(new_path, R_OK) == 0) {
  1163. X             free(icon_path);
  1164. X             return(icon_load_svrim(new_path, message));
  1165. X             }
  1166. X          else if (q != NULL)
  1167. X             p = q + 1;
  1168. X          else
  1169. X             break;
  1170. X          }
  1171. X       free(icon_path);
  1172. X       return(icon_load_svrim(path, message));
  1173. X       }
  1174. X}
  1175. END_OF_FILE
  1176. if test 2086 -ne `wc -c <'load_icon.c'`; then
  1177.     echo shar: \"'load_icon.c'\" unpacked with wrong size!
  1178. fi
  1179. # end of 'load_icon.c'
  1180. fi
  1181. if test -f 'manifest.h' -a "${1}" != "-c" ; then 
  1182.   echo shar: Will not clobber existing file \"'manifest.h'\"
  1183. else
  1184. echo shar: Extracting \"'manifest.h'\" \(1725 characters\)
  1185. sed "s/^X//" >'manifest.h' <<'END_OF_FILE'
  1186. X/************************************************************************/
  1187. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1188. X/*                                    */
  1189. X/*    Permission to use, copy, modify, and distribute this software    */
  1190. X/*    and its documentation for any purpose and without fee is    */
  1191. X/*    hereby granted, provided that the above copyright notice    */
  1192. X/*    appear in all copies and that both that copyright notice and    */
  1193. X/*    this permission notice appear in supporting documentation, and    */
  1194. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1195. X/*    used in advertising or publicity pertaining to distribution    */
  1196. X/*    of the software without specific, written prior permission.    */
  1197. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1198. X/*    about the suitability of this software for any purpose.  It is    */
  1199. X/*    provided "as is" without express or implied warranty.  This     */
  1200. X/*    software may not be sold without the prior explicit permission    */
  1201. X/*    of Harris Corporation.                        */
  1202. X/************************************************************************/
  1203. X
  1204. X/************************************************************************/
  1205. X/*                                    */
  1206. X/*    manifest.h    simple manifest constants            */
  1207. X/*                                    */
  1208. X/************************************************************************/
  1209. X
  1210. X#define        TRUE            1
  1211. X#define        FALSE            0
  1212. X
  1213. X#define        PRIVATE            static
  1214. X#define        PUBLIC            extern
  1215. X#define        EXPORT
  1216. X
  1217. X#ifndef    NULL
  1218. X#define        NULL            0
  1219. X#endif
  1220. X
  1221. X#if !defined(ICON_PATH)
  1222. X#define        ICON_PATH        ".:./icons:/usr/local/images:/usr/include/images"
  1223. X#endif
  1224. X
  1225. X#define        strsave(x)        (((x) == NULL)? NULL : (char *) strcpy((char *) malloc(strlen(x) + 1), x))
  1226. X#define        cond_free(x)        ((x)? free(x) : 0)
  1227. X
  1228. XPUBLIC    int    errno;
  1229. XPUBLIC    char    *sys_errlist[];
  1230. END_OF_FILE
  1231. if test 1725 -ne `wc -c <'manifest.h'`; then
  1232.     echo shar: \"'manifest.h'\" unpacked with wrong size!
  1233. fi
  1234. # end of 'manifest.h'
  1235. fi
  1236. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  1237.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  1238. else
  1239. echo shar: Extracting \"'patchlevel.h'\" \(243 characters\)
  1240. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  1241. X/************************************************************************/
  1242. X/*                                    */
  1243. X/*    Patch        Comments                    */
  1244. X/*      0        Initial release for XView            */
  1245. X/*                                    */
  1246. X/************************************************************************/
  1247. END_OF_FILE
  1248. if test 243 -ne `wc -c <'patchlevel.h'`; then
  1249.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  1250. fi
  1251. # end of 'patchlevel.h'
  1252. fi
  1253. if test -f 'sample.filter' -a "${1}" != "-c" ; then 
  1254.   echo shar: Will not clobber existing file \"'sample.filter'\"
  1255. else
  1256. echo shar: Extracting \"'sample.filter'\" \(2201 characters\)
  1257. sed "s/^X//" >'sample.filter' <<'END_OF_FILE'
  1258. Xdefaults {
  1259. X   beep                 3
  1260. X   flash                yes
  1261. X   open                 no
  1262. X   stamp                yes
  1263. X   good_icon            ""
  1264. X   check_icon           ""
  1265. X   flash_icon           ""
  1266. X   print                "lpr"
  1267. X   log_file             ""
  1268. X   log_before_filtering no
  1269. X   timestamp            10
  1270. X   display              32768
  1271. X   delete               1024
  1272. X}
  1273. Xfilters {
  1274. X   {
  1275. X      match   "su: chuck"
  1276. X      comment "Track myself becoming super user"
  1277. X      ignore  no
  1278. X      beep    0
  1279. X      flash   no
  1280. X      open    no
  1281. X      stamp   yes
  1282. X   }
  1283. X   {
  1284. X      match   "su:"
  1285. X      comment "Get excited about anyone else becoming superuser"
  1286. X      ignore  no
  1287. X      beep    4
  1288. X      flash   no
  1289. X      open    yes
  1290. X      stamp   yes
  1291. X   }
  1292. X   {
  1293. X      match   "Window data lock"
  1294. X      to      "The offending process"
  1295. X      comment "Ignore spurious window system messages"
  1296. X      ignore  yes
  1297. X   }
  1298. X   {
  1299. X      match   "win ioctl number"
  1300. X      comment "Ignore spurious window system messages"
  1301. X      ignore  no
  1302. X      beep    0
  1303. X      flash   no
  1304. X      open    no
  1305. X      stamp   yes
  1306. X   }
  1307. X   {
  1308. X      match   "A tty window"
  1309. X      to      "Its child"
  1310. X      comment "Ignore spurious window system messages"
  1311. X      ignore  no
  1312. X      beep    0
  1313. X      flash   no
  1314. X      open    no
  1315. X      stamp   yes
  1316. X   }
  1317. X   {
  1318. X      match   "Too large a window number"
  1319. X      comment "Ignore spurious window system messages"
  1320. X      ignore  yes
  1321. X   }
  1322. X   {
  1323. X      match   "NFS server"
  1324. X      comment "Track NFS server message"
  1325. X      ignore  no
  1326. X      beep    0
  1327. X      flash   no
  1328. X      open    no
  1329. X      stamp   yes
  1330. X   }
  1331. X   {
  1332. X      match   "yp:"
  1333. X      comment "Track YP server problems"
  1334. X      ignore  no
  1335. X      beep    0
  1336. X      flash   no
  1337. X      open    no
  1338. X      stamp   yes
  1339. X   }
  1340. X   {
  1341. X      match   "/usr/local/frame"
  1342. X      comment "Ignore various noisy Frame messages"
  1343. X      ignore  yes
  1344. X   }
  1345. X   {
  1346. X      match   "starting maker"
  1347. X      to      "maker: Finished"
  1348. X      comment "Ignore various noisy Frame messages"
  1349. X      ignore  yes
  1350. X   }
  1351. X   {
  1352. X      match   "maker:"
  1353. X      comment "Ignore various noisy Frame messages"
  1354. X      ignore  yes
  1355. X   }
  1356. X   {
  1357. X      match   "fmprintdriver.ps: Using"
  1358. X      comment "Ignore various noisy Frame messages"
  1359. X      ignore  yes
  1360. X   }
  1361. X}
  1362. END_OF_FILE
  1363. if test 2201 -ne `wc -c <'sample.filter'`; then
  1364.     echo shar: \"'sample.filter'\" unpacked with wrong size!
  1365. fi
  1366. # end of 'sample.filter'
  1367. fi
  1368. if test -f 'window_misc.c' -a "${1}" != "-c" ; then 
  1369.   echo shar: Will not clobber existing file \"'window_misc.c'\"
  1370. else
  1371. echo shar: Extracting \"'window_misc.c'\" \(3321 characters\)
  1372. sed "s/^X//" >'window_misc.c' <<'END_OF_FILE'
  1373. X/************************************************************************/
  1374. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1375. X/*                                    */
  1376. X/*    Permission to use, copy, modify, and distribute this software    */
  1377. X/*    and its documentation for any purpose and without fee is    */
  1378. X/*    hereby granted, provided that the above copyright notice    */
  1379. X/*    appear in all copies and that both that copyright notice and    */
  1380. X/*    this permission notice appear in supporting documentation, and    */
  1381. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1382. X/*    used in advertising or publicity pertaining to distribution    */
  1383. X/*    of the software without specific, written prior permission.    */
  1384. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1385. X/*    about the suitability of this software for any purpose.  It is    */
  1386. X/*    provided "as is" without express or implied warranty.  This     */
  1387. X/*    software may not be sold without the prior explicit permission    */
  1388. X/*    of Harris Corporation.                        */
  1389. X/************************************************************************/
  1390. X
  1391. X/************************************************************************/
  1392. X/*                                    */
  1393. X/*    window_misc.c    miscellaneous window management functions    */
  1394. X/*                                    */
  1395. X/************************************************************************/
  1396. X
  1397. X#include    <stdio.h>
  1398. X#include    <sys/param.h>
  1399. X#include    <sys/types.h>
  1400. X#include    <xview/xview.h>
  1401. X#include    <xview/panel.h>
  1402. X#include    <xview/xv_xrect.h>
  1403. X
  1404. X#include    "manifest.h"
  1405. X#include    "contool_ui.h"
  1406. X
  1407. X/************************************************************************/
  1408. XEXPORT    void    pinned_menu_notify(menu, item)
  1409. X
  1410. XMenu        menu;
  1411. XMenu_item    item;
  1412. X
  1413. X{    Xv_opaque    pin_window     = (Xv_opaque) xv_get(menu, MENU_PIN_WINDOW);
  1414. X    void        (*menu_notify)() = (void (*)()) xv_get(menu, MENU_GEN_PROC);
  1415. X    void        (*item_notify)() = (void (*)()) xv_get(item, MENU_GEN_PROC);
  1416. X    
  1417. X    if (pin_window && xv_get(pin_window, XV_SHOW)) {
  1418. X       if (menu_notify)
  1419. X          (*menu_notify)(menu, MENU_NOTIFY);
  1420. X       if (item_notify)
  1421. X          (*item_notify)(item, MENU_NOTIFY);
  1422. X       if (item_notify)
  1423. X          (*item_notify)(item, MENU_NOTIFY_DONE);
  1424. X       if (menu_notify)
  1425. X          (*menu_notify)(menu, MENU_NOTIFY_DONE);
  1426. X    }
  1427. X}
  1428. X
  1429. X/************************************************************************/
  1430. XEXPORT    Panel_setting    file_completion(item, event)
  1431. X
  1432. XPanel_item    item;
  1433. XEvent        *event;
  1434. X
  1435. X{    char    *p, *expand_filename();
  1436. X
  1437. X    switch (event_action(event)) {
  1438. X       case '\n' :
  1439. X       case '\r' :
  1440. X       case ' '  : if ((p = expand_filename(xv_get(item, PANEL_VALUE))) == NULL)
  1441. X                 window_bell(xv_get(item, XV_OWNER));
  1442. X                  else
  1443. X                     xv_set(item, PANEL_VALUE, p, 0);
  1444. X                  return(PANEL_NONE);
  1445. X       default   : return(panel_text_notify(item, event));
  1446. X       }
  1447. X}
  1448. X
  1449. X/************************************************************************/
  1450. XEXPORT    void    place_dialog(base, dialog)
  1451. X
  1452. XXv_opaque    base;
  1453. XXv_opaque    dialog;
  1454. X
  1455. X{    Rect    br, dr, sr;
  1456. X
  1457. X    sr = *((Rect *) xv_get(base, WIN_SCREEN_RECT));
  1458. X    frame_get_rect(base, &br);
  1459. X    frame_get_rect(dialog, &dr);
  1460. X    if (rect_right(&br) + dr.r_width < sr.r_width) {
  1461. X       dr.r_left = rect_right(&br);
  1462. X       dr.r_top = br.r_top;
  1463. X       }
  1464. X    else if (dr.r_width <= br.r_left) {
  1465. X       dr.r_left = br.r_left - dr.r_width;
  1466. X       dr.r_top = br.r_top;
  1467. X       }
  1468. X    else {
  1469. X       dr.r_left = br.r_left + 32;
  1470. X       dr.r_top = br.r_top + 32;
  1471. X       }
  1472. X    frame_set_rect(dialog, &dr);
  1473. X}
  1474. END_OF_FILE
  1475. if test 3321 -ne `wc -c <'window_misc.c'`; then
  1476.     echo shar: \"'window_misc.c'\" unpacked with wrong size!
  1477. fi
  1478. # end of 'window_misc.c'
  1479. fi
  1480. echo shar: End of archive 1 \(of 6\).
  1481. cp /dev/null ark1isdone
  1482. MISSING=""
  1483. for I in 1 2 3 4 5 6 ; do
  1484.     if test ! -f ark${I}isdone ; then
  1485.     MISSING="${MISSING} ${I}"
  1486.     fi
  1487. done
  1488. if test "${MISSING}" = "" ; then
  1489.     echo You have unpacked all 6 archives.
  1490.     rm -f ark[1-9]isdone
  1491. else
  1492.     echo You still need to unpack the following archives:
  1493.     echo "        " ${MISSING}
  1494. fi
  1495. ##  End of shell archive.
  1496. exit 0
  1497.  
  1498. Chuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  1499. Harris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  1500. PO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  1501. Melbourne, FL 32902            FAX   : (407) 727-{5118,5227,4004}
  1502.  
  1503. I'm glad you asked, son.  Being popular
  1504.     is the most important thing in the world.    -- Homer Simpson
  1505.